<?php
	class Loader{
		public static $loader;
		/**
		@class 	Loader
		
		Charge automatiquement les class nécéssaire
		*/

		public static function init(){
			if (self::$loader == NULL)
            self::$loader = new self();

        	return self::$loader;
		}

		function __construct(){
			spl_autoload_register(array($this,'loadLib'));
		}

		function loadLib($classname){			
			if(strstr($classname,"Eden")){
				return null;
			}
			$file = "./class/".$classname.".class.php";
			if(file_exists($file)){
				include($file);
				if(!class_exists($classname, false)){
					return null;
				}
			}else{
				return null;
			}
		}
	}
	Loader::init();
?>